package com.wh.wisdomsite.xbox.server.manager;

import com.wh.wisdomsite.xbox.core.security.AppSecretManager;

import java.util.HashMap;
import java.util.Map;

/**
 * <pre>
 * 功能说明：
 * </pre>
 *
 * @author launchso
 * @version 1.0
 */
public class SampleAppSecretManager implements AppSecretManager {

    private static Map<String, String> appKeySecretMap = new HashMap<String, String>();

/*    static {
        appKeySecretMap.put("11", "df");
        appKeySecretMap.put("12","abcdeabcdeabcdeabcdeaaaaa");
        appKeySecretMap.put("13","abcdeabcdeabcdeabcdeaaaaa");
    }*/

    @Override
    public String getSecret(String appKey) {
        return appKeySecretMap.get(appKey);
    }

    @Override
    public boolean isValidAppKey(String appKey) {
        return getSecret(appKey) != null;
    }

    public Map<String, String> appKeySecretMap() {
        return appKeySecretMap;
    }

    public void setAppKeySecretMap(Map<String, String> appKeySecretMap) {
        SampleAppSecretManager.appKeySecretMap = appKeySecretMap;
    }
}

